package com.senlingspace.system.service.impl;

import java.util.List;
import com.senlingspace.common.utils.DateUtils;
import com.senlingspace.system.domain.vo.ShopOperateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.senlingspace.system.mapper.SlkjShopOperateMapper;
import com.senlingspace.system.domain.SlkjShopOperate;
import com.senlingspace.system.service.ISlkjShopOperateService;

/**
 * 分账比例设置-门店运营商关系Service业务层处理
 * 
 * @author wangliang
 * @date 2024-07-15
 */
@Service
public class SlkjShopOperateServiceImpl implements ISlkjShopOperateService 
{
    @Autowired
    private SlkjShopOperateMapper slkjShopOperateMapper;

    /**
     * 查询分账比例设置-门店运营商关系
     * 
     * @param id 分账比例设置-门店运营商关系主键
     * @return 分账比例设置-门店运营商关系
     */
    @Override
    public SlkjShopOperate selectSlkjShopOperateById(Long id)
    {
        return slkjShopOperateMapper.selectSlkjShopOperateById(id);
    }

    /**
     * 查询分账比例设置-门店运营商关系列表
     * 
     * @param slkjShopOperate 分账比例设置-门店运营商关系
     * @return 分账比例设置-门店运营商关系
     */
    @Override
    public List<SlkjShopOperate> selectSlkjShopOperateList(SlkjShopOperate slkjShopOperate)
    {
        return slkjShopOperateMapper.selectSlkjShopOperateList(slkjShopOperate);
    }

    /**
     * 新增分账比例设置-门店运营商关系
     * 
     * @param slkjShopOperate 分账比例设置-门店运营商关系
     * @return 结果
     */
    @Override
    public int insertSlkjShopOperate(SlkjShopOperate slkjShopOperate)
    {
        slkjShopOperate.setCreateTime(DateUtils.getNowDate());
        return slkjShopOperateMapper.insertSlkjShopOperate(slkjShopOperate);
    }

    /**
     * 修改分账比例设置-门店运营商关系
     * 
     * @param slkjShopOperate 分账比例设置-门店运营商关系
     * @return 结果
     */
    @Override
    public int updateSlkjShopOperate(SlkjShopOperate slkjShopOperate)
    {
        slkjShopOperate.setUpdateTime(DateUtils.getNowDate());
        return slkjShopOperateMapper.updateSlkjShopOperate(slkjShopOperate);
    }

    /**
     * 批量删除分账比例设置-门店运营商关系
     * 
     * @param ids 需要删除的分账比例设置-门店运营商关系主键
     * @return 结果
     */
    @Override
    public int deleteSlkjShopOperateByIds(Long[] ids)
    {
        return slkjShopOperateMapper.deleteSlkjShopOperateByIds(ids);
    }

    /**
     * 删除分账比例设置-门店运营商关系信息
     * 
     * @param id 分账比例设置-门店运营商关系主键
     * @return 结果
     */
    @Override
    public int deleteSlkjShopOperateById(Long id)
    {
        return slkjShopOperateMapper.deleteSlkjShopOperateById(id);
    }

    /**
     * 根据门店id获取运营方分账信息
     *
     * @author wangliang
     * @param shopId  门店ID
     * @return java.util.List<com.senlingspace.system.domain.vo.ShopOperateVo>
     */
    @Override
    public ShopOperateVo selectOperateShopByShopId(Long shopId) {
        return slkjShopOperateMapper.selectOperateShopByShopId(shopId);
    }
}
